<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
		<style>
			[v-cloak]{
				display: none;
			}
		</style>
		<script src="./src/vue.js"></script>
	</head>

	<body>
		<div id="app">
			<input v-model="val" @keyup.13="addItem"/>
			<ul>
				<li v-for="item in arr">{{item}}</li>
			</ul>
		</div>
		<script>


			let vm = new Vue({
				el:'#app',
				data: {
					arr: [1,2,3],
					val:''
				},
				methods: {
					addItem (ev) {
						this.arr.push(this.val);
						this.val = '';
					}
				}
			})


		</script>
	</body>
</html>